package org.example.mall4j.Controller;

import jakarta.annotation.Resource;
import org.example.mall4j.Service.OrderService;
import org.example.mall4j.Utils.ByscripUtil;
import org.example.mall4j.dao.OrderMapper;
import org.example.mall4j.pojo.Order;
import org.example.mall4j.pojo.OrderParam;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private OrderMapper orderMapper;
    private OrderService orderService;
    @GetMapping("/test/{ps}")
    public Object TestMap(@PathVariable String ps){
//        return orderMapper.findOrderItemById(1L);
        return new ByscripUtil().GenerateBystring(ps);
    }
    @PostMapping("/Createorder")
    public Order CreateOrder(@RequestBody OrderParam orderParam){
        return orderService.CreateOrder(orderParam);
    }
}
